export const initOilInfo = (index = 1) => {
  return {
    index,
    topicIndex: index,
    tankPress: 0,
    tankTemp: 0,
    levelHeight: 0,
    fuelVolume: 0,
    fuelWeight: 0,
  }
}

export const oilConfig = {
  1: {
    volume: 26.94, // 体积
    weight: 22.9, // 重量
    name: "F.O.1.P",
    subName: "1.P",
    topicIndex: 1,
  },
  2: {
    volume: 9.38,
    weight: 7.98,
    name: "F.O.2.P",
    subName: "2.P",
    topicIndex: 2,
  },
  3: {
    volume: 18.15,
    weight: 15.42,
    name: "F.O.3.P",
    subName: "3.P",
    topicIndex: 3,
  },
  4: {
    volume: 26.94,
    weight: 22.9,
    name: "F.O.1.S",
    subName: "1.S",
    topicIndex: 4,
  },
  5: {
    volume: 9.38,
    weight: 7.98,
    name: "F.O.2.S",
    subName: "2.S",
    topicIndex: 5,
  },
  6: {
    volume: 18.15,
    weight: 15.42,
    name: "F.O.3.S",
    subName: "3.S",
    topicIndex: 6,
  },
  7: {
    volume: 18.15,
    weight: 15.42,
    name: "LO",
    subName: "LO",
    topicIndex: 7,
  },
};

export const initMainInfo = (index = 1) => {
  return {
    index,
    mainEngineOilPress: 0,
    mainEngineOilTemp: 0,
    mainEngineWaterTemp: 0,
    mainEngineStartAirPress: 0,
    mainEngineLeftExhTemp: 0,
    mainEngineRightExhTemp: 0,
    gearboxOilPress: 0,
    gearboxOilTemp: 0,
    gearboxWorkPress: 0,
    sysVoltage: 0,
    mainEngineRpm: 0,
    mainEngineRunTime: 0,
    running: 0,
  }
}

export const initGeneratorInfo = (index = 1) => {
  return {
    index,
    engineRpm: 0,
    enginePowerVoltage: 0,
    mainengineOilPressure: 0,
    engineOilTemp: 0,
    engineCoolingWaterTemp: 0,
    engineRunningTime: 0,
    engineRunningStatus: 0,
    enginePositionStatus: 0,
  }
}

export const initSideGeneratorInfo = () => {
  return {
    dieselEngineRpm: 0,
    lubeOilPressure: 0,
    freshWaterTemp: 0,
    lubeOilTemp: 0,
    batteryVolt: 0,
    totalRunTime: 0,
  }
}